#include <iostream>
using namespace std;
class Solution {
public:
	int waystotop(int n) {
		if (n <= 1)return 1;
		if (n == 2)return 2;
		long long MOD = 1000000007;
		int p1 = 1, p2 = 1, p3 = 2, p4;
		for (int i = 3; i <= n; i++) {
			p4 = ((p1 + p2) % MOD + p3) % MOD;
			p1 = p2;
			p2 = p3;
			p3 = p4;
		}
		return p3;
	}
};
int main() {
	Solution sol;
	int a = 0;
	while (cin>>a) {
		int aa = sol.waystotop(a);
		cout << aa << endl;
	}
	return 0;
}